#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=2005,M=1e5+5;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-48,ch=getchar();}
	return x*f;
}
int n,m,f[N][N],pre[N][N],st[N],tp,sum[N],lst[N],now[N];
bool vis[N];
string s,t;

int fs[M][25],pres[M][25],sts[M],tps,sums[M],lsts[M],nows[M];
bool viss[M];

signed main(){
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin>>s>>t;
	n=s.size(),m=t.size();
	s='$'+s,t='$'+t;
	if(n<=2000&&m<=2000){
		for(int i=1;i<=n;i++) sum[i]=sum[i-1]+s[i]-'0';
		vis[0]=1;
		for(int i=1;i<=n;i++){
			for(int j=min(i,m);j>0;j--){
				if(s[i]!=t[j]) continue;
				int pos=now[j-1];
				if(vis[j-1]&&sum[i-1]-sum[pos]==0||sum[i-1]-sum[pos]==i-pos-1) lst[j]=pos,vis[j]=1,now[j]=i,pre[i][j]=pos;
			}
		}
		if(!vis[m]) puts("NO");
		else{
			puts("YES");
			int x=now[m];
			int cnt=m;
			while(x){
				st[++tp]=x;
				x=pre[x][m];
				m--;
			}
			for(int i=tp;i;i--) printf("%lld ",st[i]);
		}	
	}
	else if(n<=100000&&m<=20){
		for(int i=1;i<=n;i++) sums[i]=sums[i-1]+s[i]-'0';
		viss[0]=1;
		for(int i=1;i<=n;i++){
			for(int j=min(i,m);j>0;j--){
				if(s[i]!=t[j]) continue;
				int pos=nows[j-1];
				if(viss[j-1]&&sums[i-1]-sums[pos]==0||sums[i-1]-sums[pos]==i-pos-1) lsts[j]=pos,viss[j]=1,nows[j]=i,pres[i][j]=pos;
			}
		}
		if(!viss[m]) puts("NO");
		else{
			puts("YES");
			int x=nows[m];
			int cnt=m;
			while(x){
				sts[++tps]=x;
				x=pres[x][m];
				m--;
			}
			for(int i=tps;i;i--) printf("%lld ",sts[i]);
		}			
	}
	else{		
		int cnt1=0,cnt2=0;
		for(int i=1;i<=n;i++) cnt1+=s[i-1]!=s[i];
		for(int i=1;i<=m;i++) cnt2+=t[i-1]!=t[i];
		if((cnt1==cnt2&&s[1]==t[1])||cnt1>cnt2){
			puts("YES");
			int tot=1;
			for(int i=1;i<=n;i++)
				if(tot<=m&&s[i]==t[tot])
					printf("%lld ",i),tot++;
		}
		else{
			puts("NO");
		}
	}
    return 0;
}